package com.seari.main;

import com.seari.task.ReadFileDataInsertToOra;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

//@Component
//@Order(value = 1)
public class StartUpClass implements ApplicationRunner {

    private static final Logger log = LoggerFactory.getLogger(StartUpClass.class);

    @Autowired
    private ReadFileDataInsertToOra readFileDataInsertToOra;

    @Override
    public void run(ApplicationArguments aa){
        log.info("===StartUpClass  init judge is or nor create table start ===");
        try {
            readFileDataInsertToOra.createTableImpl();
        } catch (Exception e) {
            e.printStackTrace();
        }
        log.info("===StartUpClass  init judge is or nor create table end ===");
    }
}
